package br.com.pesca.persistence;

import br.com.pesca.dao.PetrechoDAO;
import br.com.pesca.entity.Petrecho;
import java.util.Arrays;
import java.util.List;

public class CadastraPetrecho {

    private static final List<String> petrechos = Arrays.asList("Arrasto", "Bloqueio", "Cacela", "Fixa",
            "Malhadeira", "Outros Petrechos");

    public static void main(String args[]) {

        PetrechoDAO dao = new PetrechoDAO();

        /*
         * Adiciona os petreichos na entidade Petrecho.
         */
        for (int i = 0; petrechos.size() > i; i++) {
            Petrecho petrecho = new Petrecho();

            petrecho.setTipoPetrecho(petrechos.get(i));

            dao.startOperation();
            dao.save(petrecho);
            dao.stopOperation(true);
        }
    }
}
